using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace ctsu.Admin.Forms
{
	/// <summary>
	/// Summary description for ProtocolDefaultChangeDlg.
	/// </summary>
	public class ProtocolDefaultChangeDlg : System.Windows.Forms.Form
	{
		public ProtocolDefaultChangeResult DefaultChangeDialogResult = ProtocolDefaultChangeResult.NoChange;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Button NoChange;
		private System.Windows.Forms.Button Prompt;
		private System.Windows.Forms.Button ChangeAll;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public ProtocolDefaultChangeDlg()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.label1 = new System.Windows.Forms.Label();
			this.NoChange = new System.Windows.Forms.Button();
			this.Prompt = new System.Windows.Forms.Button();
			this.ChangeAll = new System.Windows.Forms.Button();
			this.SuspendLayout();
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(40, 16);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(352, 16);
			this.label1.TabIndex = 0;
			this.label1.Text = "Select how you want to handle existing visit records for this protocol.";
			// 
			// NoChange
			// 
			this.NoChange.Location = new System.Drawing.Point(8, 48);
			this.NoChange.Name = "NoChange";
			this.NoChange.Size = new System.Drawing.Size(128, 23);
			this.NoChange.TabIndex = 1;
			this.NoChange.Text = "Make No Changes";
			this.NoChange.Click += new System.EventHandler(this.button_Click);
			// 
			// Prompt
			// 
			this.Prompt.Location = new System.Drawing.Point(152, 48);
			this.Prompt.Name = "Prompt";
			this.Prompt.Size = new System.Drawing.Size(128, 23);
			this.Prompt.TabIndex = 2;
			this.Prompt.Text = "Prompt For Each Visit";
			this.Prompt.Click += new System.EventHandler(this.button_Click);
			// 
			// ChangeAll
			// 
			this.ChangeAll.Location = new System.Drawing.Point(296, 48);
			this.ChangeAll.Name = "ChangeAll";
			this.ChangeAll.Size = new System.Drawing.Size(128, 23);
			this.ChangeAll.TabIndex = 3;
			this.ChangeAll.Text = "Change All Visits";
			this.ChangeAll.Click += new System.EventHandler(this.button_Click);
			// 
			// ProtocolDefaultChangeDlg
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(432, 86);
			this.ControlBox = false;
			this.Controls.Add(this.ChangeAll);
			this.Controls.Add(this.Prompt);
			this.Controls.Add(this.NoChange);
			this.Controls.Add(this.label1);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
			this.Name = "ProtocolDefaultChangeDlg";
			this.Text = "Protocol Default Change";
			this.ResumeLayout(false);

		}
		#endregion

		private void button_Click(object sender, System.EventArgs e)
		{
			string name = ((Control)sender).Name;

			switch(name)
			{
				case "NoChange":
					this.DefaultChangeDialogResult = ProtocolDefaultChangeResult.NoChange;
					break;
				case "Prompt":
					this.DefaultChangeDialogResult = ProtocolDefaultChangeResult.Prompt;
					break;
				case "ChangeAll":
					this.DefaultChangeDialogResult = ProtocolDefaultChangeResult.ChangeAll;
					break;
			}
			this.Close();
		}
	}

	public enum ProtocolDefaultChangeResult
	{
		NoChange,
		Prompt,
		ChangeAll
	}
}
